﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="head.ascx.cs" Inherits="head" %>
<ul class="mininav">
 <li class="of-ot-oznt-01">欢迎来到ESHOP 网商宝商城&nbsp;<a style="display:none" id="member_username" href="member_center.aspx" target="_blank"></a>&nbsp;<a id="login" href="login.aspx" class="LineR">登录</a> &nbsp;<a id="registe" href="login.aspx">注册</a>&nbsp;<a id='logout' style="display:none; cursor:pointer">退出</a></li>
 <li class="of-ot-oznt-02"><a href="member_center.aspx" class="LineR">会员管理</a><a href="member_center.aspx" class="LineR">超级积分俱乐部</a><a href="shoppingCart.aspx" class="LineR">购物车</a><a href="favorite.aspx" class="LineR">收藏夹</a><a href="help.aspx" class="LineR">帮助中心</a> &nbsp;销售热线：<img src="images/icon-003.gif" alt="400-678-1128" /></li>
</ul>
<!-- /end mininav -->
<div class="header">
 <h1 class="logo"><a href="/"><img src="images/icon-000.gif" alt="ESHOP 网商宝商城" /></a></h1>
 <!-- /end logo -->
 <ul class="SearchForm">
  <li class="pf-th-otz">关键字：</li>
  <li class="textarea1"><input name="txtKeyword" id="txtKeyword" class="textarea" type="text" /></li>
  <li class="pf-th-otz">价格从</li>
  <li class="textarea2"><input name="txtMaxPrice" id="txtMaxPrice" class="textarea" type="text" /></li>
  <li class="pf-th-otz">到</li>
  <li class="textarea2"><input name="txtMinPrice" id="txtMinPrice" class="textarea" type="text" /></li>
  <li class="textarea3"><input name="btnSearch" id="btnSearch" class="butarea" type="button" value="搜索" /></li>
  <li class="pf-th-otz"><a href="#"></a></li>
 </ul>
 <!-- /end SearchForm -->
 <ul class="navigation">
  <li><a href="default.aspx"><span>首页</span></a></li>
  <li><a href="p_list.aspx?isNew=1"><span>最新商品</span></a></li>
  <li><a href="p_list.aspx?categoryId=544"><span>瓷砖·陶瓷</span></a></li>
  <li><a href="p_list.aspx?categoryId=543"><span>地板·天花</span></a></li>
  <li><a href="p_list.aspx?categoryId=542"><span>卫浴·洁具</span></a></li>
  <li><a href="p_list.aspx?categoryId=541"><span>橱柜·衣柜</span></a></li>
  <li><a href="p_list.aspx?categoryId=540"><span>油漆·涂料</span></a></li>
  <li><a href="p_list.aspx?categoryId=539"><span>门窗·灯饰</span></a></li>
  <li><a href="p_list.aspx?categoryId=537"><span>五金·电器</span></a></li>
  <li><a href="news_list.aspx?categoryId=7"><span>团购专区</span></a></li>
 </ul>
 <!-- /end navigation -->
 <ul class="navigationde">
  <li><a href="p_show.aspx?productId=33" target="_blank">浴室柜</a></li>
  <li><a href="p_show.aspx?productId=28"  target="_blank">台盆</a></li>
  <li><a href="p_show.aspx?productId=19" target="_blank">玉兰墙纸</a></li>
  <li><a href="p_show.aspx?productId=16" target="_blank">永高壁纸</a></li>
 </ul>
 <!-- /end navigationde -->
</div>
<!-- /end header -->
<script src="js/common.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('#btnSearch').bind('click',function(){
        var keyword = $.trim($('#txtKeyword').val());
        var maxPrice= $.trim($('#txtMaxPrice').val());
        var minPrice = $.trim($('#txtMinPrice').val());
        var query = [];
        var queryUrl="";
        if(keyword.length>0)
            query.push("keyword="+keyword);
        var numberReg = /^\d+$/;
        if(maxPrice.length>0){
            if(!numberReg.test(maxPrice)){
                alert("最高价格必须为数字");
                return false;
            }else{
                query.push("maxPrice="+maxPrice);
            }
        }
        if(minPrice.length>0){
            if(!numberReg.test(minPrice)){
                alert("最低价格必须为数字");
                return false;
            }else{
                query.push("minPrice="+minPrice);   
            }
        }
        queryUrl = query.join('&');
        window.location.href='p_list.aspx?'+queryUrl; 
    });
    var username = getCookie('tmjcshop_userName');
    if(username!=null){
        $('#member_username').html(username);
        $('#member_username').show();
    }else{
        $('#member_username').hide();
    }
    var isLogin = getCookie('tmjcshop_isLogin');
    if(isLogin!=null && isLogin=="yes"){
        $('#logout').show();
        $('#login').hide();
        $('#registe').hide();
        $('#logout').bind('click',function(){
            delCookie('tmjcshop_isLogin');
            $(this).hide();
            window.location.href='login.aspx';
        });
    }else{
        $('#logout').hide();
        $('#login').show();
        $('#registe').show();
    }
    
    
});
    
</script>